package com.example.otpdemo2;


import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @date: 2023/10/25 12:13
 * @author: hp
 * @description: TODO
 */
@Service
public class UserDaoImpl implements UserDao {
    private final static Map<String, String> keyMap = new HashMap<>();

    @Override
    public String getSecretKey(String userName) {
        return keyMap.get(userName);
    }

    @Override
    public boolean saveUserCredentials(String userName, String secretKey) {
        keyMap.put(userName, secretKey);
        return true;
    }
}
